//导入工具类
import request from "@/utils/request";

//查询所有企业地址
export const getAllPosition = (PageNum,PageSize) =>{
    let page = {
        PageNum:PageNum,
        PageSize:PageSize
    }
    return request.get("/postskill/selectPosition",page);
}

//根据id查询用户
export const getPositionId = (postskillId) =>{
    return request.get(`/postskill/${postskillId}`);
}

//根据id查询用户
export const getPositionAsk = (pageNum,pageSize) =>{
    let page = {
        pageNum:pageNum,
        pageSize:pageSize
    }
    return request.get(`/postask/page`,page);
}
//根据企业id查询
export const byPostIdAsk = (postId) =>{
    return request.get(`/postask/${postId}`);
}

//查询总页数
export const getAllPage = () =>{
    return request.get("/asktype");
}

//删除企业地址
export const delAsk = (askTypeId) =>{
    return request.get(`/asktype/del?id=${askTypeId}`);
}
export const selectAskType = (pageNum,pageSize,keyWord) =>{
    let data = {
        pageNum:pageNum,
        pageSize:pageSize,
        keyWord:keyWord
    }
    return request.get("/asktype/page",data);
}
//添加要求
export const savePostAsk = (data) =>{
    let post = {
        postid:data.postId,
        askId:data.askTypeId,
    }
    return request.post("/postask/save",post);
}
export const addAskType = (data) =>{
    let ask = {
        askTypeId:data.askTypeId,
        askTypeName: data.askTypeName,
        tip:0
    }
    console.log(ask,"22222222");
    return request.post(`/asktype`,ask);
}

export const selectCompanyPost = () =>{
    return request.get("/companypost");
}
export const selectCompanyByPostId = (postId) =>{
    return request.get(`/companypost/${postId}`);
}


